#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void on_ConfigButton_clicked();

    void on_ClrPushButton_clicked();

    void on_CalcButton_clicked();

    void on_localBtn_clicked();

private:
    void Base64ToHex(QString&, int);
    void HexToBase64(QString&, int);
    void NBDecryption(QString&, int);
    void XXTEAEncryption(QString&, int);
    void XXTEADecryption(QString&, int);

    char *encode(const char *, char *, unsigned int);
    unsigned int decode(const char *, unsigned int, char *, unsigned int);
    int16_t GdecBase64(const char* indata, char *outdata, uint16_t inlen);

    bool decryption(const char *, char *, unsigned int);

    int hexStrToChar(char);
    QByteArray hexStrToByteArray(const QString&);

    bool checkHexStr(QString&, bool);
private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H
